<!DOCTYPE html>
<html>
<head>
    <title>Binding to local data</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" >

    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.dataviz.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.dataviz.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    
        <div id="example" class="k-content">
            <div class="chart-wrapper">
                <div id="chart"></div>
                <ul class="k-content">
                    <li>Circle size shows number of job applicants</li>
                    <li>Vertical position shows number of employees</li>
                    <li>Horizontal position shows job growth</li>
                </ul>
            </div>
            <script>
                var jobGrowth = [{
                    growth: -2500,
                    jobs: 50000,
                    applications: 500000,
                    company: "Microsoft"
                }, {
                    growth: 500,
                    jobs: 110000,
                    applications: 7600000,
                    company: "Starbucks"
                }, {
                    growth: 7000,
                    jobs: 19000,
                    applications: 700000,
                    company: "Google"
                }, {
                    growth: 1400,
                    jobs: 150000,
                    applications: 700000,
                    company: "Publix Super Markets"
                }, {
                    growth: 2400,
                    jobs: 30000,
                    applications: 300000,
                    company: "PricewaterhouseCoopers"
                }, {
                    growth: 2450,
                    jobs: 34000,
                    applications: 90000,
                    company: "Cisco"
                }, {
                    growth: 2700,
                    jobs: 34000,
                    applications: 400000,
                    company: "Accenture"
                }, {
                    growth: 2900,
                    jobs: 40000,
                    applications: 450000,
                    company: "Deloitte"
                }, {
                    growth: 3000,
                    jobs: 55000,
                    applications: 900000,
                    company: "Whole Foods Market"
                }];

                function createChart() {
                    $("#chart").kendoChart({
                        theme: $(document).data("kendoSkin") || "default",
                        title: {
                            text: "Job Growth for 2011"
                        },
                        legend: {
                            visible: false
                        },
                        dataSource: {
                            data: jobGrowth
                        },
                        series: [{
                            type: "bubble",
                            xField: "growth",
                            yField: "jobs",
                            sizeField: "applications",
                            categoryField: "company"
                        }],
                        xAxis: {
                            labels: {
                                format: "{0:N0}",
                                skip: 1
                            },
                            axisCrossingValue: -5000,
                            majorUnit: 2000,
                            plotBands: [{
                                from: -5000,
                                to: 0,
                                color: "#00f",
                                opacity: 0.05
                            }]
                        },
                        yAxis: {
                            labels: {
                                format: "{0:N0}"
                            },
                            line: {
                                width: 0
                            }
                        },
                        tooltip: {
                            visible: true,
                            format: "{3}: {2:N0} applications",
                            opacity: 1
                        }
                    });
                }

                $(document).ready(function() {
                    setTimeout(function() {
                        // Initialize the chart with a delay to make sure
                        // the initial animation is visible
                        createChart();

                        $("#example").bind("kendo:skinChange", function(e) {
                            createChart();
                        });
                    }, 400);
                });
            </script>
            <style scoped>
                .chart-wrapper {
                    position: relative;
                }

                .chart-wrapper ul {
                    font-size: 11px;
                    margin: 62px 16px 0 0;
                    padding: 30px;
                    position: absolute;
                    right: 0;
                    top: 0;
                    text-transform: uppercase;
                    width: 150px;
                    height: 105px;
                }
            </style>
        </div>

</body>
</html>
